# $Id$
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Federico Quagliata (quaqo) <quaqo@despammed.com>

pkgname=cracklib
pkgver=2.9.6
pkgrel=1
pkgdesc="Password Checking Library"
arch=('i686' 'x86_64')
license=('GPL')
url="https://github.com/cracklib/cracklib"
depends=('glibc' 'zlib')
source=(https://github.com/cracklib/cracklib/releases/download/$pkgname-$pkgver/$pkgname-$pkgver.tar.gz)
md5sums=('c52f463585d85924b28cdc1e373ae06d')

build() {
  cd $srcdir/$pkgname-$pkgver
  ./configure --prefix=/usr --sbindir=/usr/bin --without-python
  make 
}

check() {
  cd $srcdir/$pkgname-$pkgver
  make check
}

package() {
  cd $srcdir/$pkgname-$pkgver
  make DESTDIR=$pkgdir install
  # symlink cracklib-small #34778
  mkdir -p $pkgdir/usr/share/dict
  ln -sf /usr/share/cracklib/cracklib-small $pkgdir/usr/share/dict/cracklib-small
  sh ./util/cracklib-format dicts/cracklib-small \
    | sh ./util/cracklib-packer $pkgdir/usr/share/cracklib/pw_dict
}
